package com.soa.zuul.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

import com.google.gson.annotations.Expose;

/**
 * GatewayUser entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "gateway_user", schema = "public")
public class GatewayUser implements java.io.Serializable {

	// Fields

	private String id;
	private String realname;
	private String usercode;
	private String phone;
	private String username;
	private String password;
	private String state;
	private String lastLoginTime;
	private String key;
	private String whiteList;
	@Expose
	private Set<GatewayUserServiceAuth> gatewayUserServiceAuths = new HashSet<GatewayUserServiceAuth>(
			0);
	private String isOpenWhiteList;
	// Constructors

	/** default constructor */
	public GatewayUser() {
	}

	/** full constructor */
	public GatewayUser(String realname, String usercode, String phone,
			String username, String password, String state,
			String lastLoginTime, String key
			) {
		this.realname = realname;
		this.usercode = usercode;
		this.phone = phone;
		this.username = username;
		this.password = password;
		this.state = state;
		this.lastLoginTime = lastLoginTime;
		this.key = key;
		
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "realname")
	public String getRealname() {
		return this.realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	@Column(name = "usercode")
	public String getUsercode() {
		return this.usercode;
	}

	public void setUsercode(String usercode) {
		this.usercode = usercode;
	}

	@Column(name = "phone", length = 50)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "username")
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "password", length = 32)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "state")
	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	@Column(name = "last_login_time")
	public String getLastLoginTime() {
		return this.lastLoginTime;
	}

	public void setLastLoginTime(String lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	@Column(name = "key", length = 50)
	public String getKey() {
		return this.key;
	}

	public void setKey(String key) {
		this.key = key;
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "gatewayUser")
	public Set<GatewayUserServiceAuth> getGatewayUserServiceAuths() {
		return this.gatewayUserServiceAuths;
	}

	public void setGatewayUserServiceAuths(
			Set<GatewayUserServiceAuth> gatewayUserServiceAuths) {
		this.gatewayUserServiceAuths = gatewayUserServiceAuths;
	}

	@Column(name = "white_list")
	public String getWhiteList() {
		return whiteList;
	}

	public void setWhiteList(String whiteList) {
		this.whiteList = whiteList;
	}
	@Column(name = "is_open_white_list")
	public String getIsOpenWhiteList() {
		return isOpenWhiteList;
	}

	public void setIsOpenWhiteList(String isOpenWhiteList) {
		this.isOpenWhiteList = isOpenWhiteList;
	}
	
}